package top.houry.im.client.oss;

import cn.hutool.core.lang.Singleton;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;

/**
 * @Desc
 * @Author houruiyang
 * @Date 2022/6/8
 **/
public class OSSClient {

    static String endpoint = "yourEndpoint";
    static String accessKeyId = "yourAccessKeyId";
    static String accessKeySecret = "yourAccessKeySecret";


    private static volatile OSS instance;

    private OSSClient() {
    }

    public static OSS getInstance() {
        if (instance == null) {
            synchronized (Singleton.class) {
                if (instance == null) {
                    instance = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
                }
            }
        }
        return instance;
    }

}
